import { http } from '@/utils/request'

const maintenanceRouteURL = '/api/maintenance'

export function apiGetMaintenance(params) {
    return http.get(maintenanceRouteURL + `/${params}`)
}

export function apiFindMaintenance(params) {
    const {
        page,
        page_size,
        venue_type_id,
        start_time,
        end_time,
        reason
    } = params
    const jsonData = {
        venue_type_id,
        start_time,
        end_time,
        reason
    }
    return http.post(maintenanceRouteURL + `/find?page=${page}&&pageSize=${page_size}`,jsonData)
}


export function apiCreateMaintenance(data) {
    return http.post(maintenanceRouteURL, data)
}

export function apiUpdateMaintenance(data) {
    return http.put(maintenanceRouteURL, data)
}

export function apiDeleteMaintenance(params) {
    return http.delete(maintenanceRouteURL + `/${params}`)
}
